using UnityEngine;
using System.Collections;

public class SplashScreens : MonoBehaviour {
	
	public Transform m_Splash1, m_Splash2;
	PackedSprite m_Packed1, m_Packed2;
	public float m_fFadeTime = 1.0f;
	void Awake()
	{
		m_Packed1 = m_Splash1.GetComponent<PackedSprite>();
		m_Packed2 = m_Splash2.GetComponent<PackedSprite>();
		//Application.LoadLevel(1);
	}
	// Use this for initialization
	void Start () 
	{
	
	}
	
	// Update is called once per frame
	void Update () 
	{
		//FadeMaterial.Do(m_Packed1.renderer.material,EZAnimation.ANIM_MODE.FromTo, Color.white, Color.clear, EZAnimation.GetInterpolator(EZAnimation.EASING_TYPE.Linear), m_fFadeTime, 0.0f, null, Del);
		FadeSpriteAlpha.Do(m_Packed1,EZAnimation.ANIM_MODE.FromTo, Color.white, Color.clear, EZAnimation.GetInterpolator(EZAnimation.EASING_TYPE.Linear), m_fFadeTime, 0.0f, null, null);
		FadeSpriteAlpha.Do(m_Packed2,EZAnimation.ANIM_MODE.FromTo, Color.clear, Color.white, EZAnimation.GetInterpolator(EZAnimation.EASING_TYPE.Linear), m_fFadeTime, m_fFadeTime, null, Del);
	
		
	}
	void Del(EZAnimation anim)
	{
		Debug.Log("Fade Complete");
		FadeSpriteAlpha.Do(m_Packed2,EZAnimation.ANIM_MODE.FromTo, Color.white, Color.clear, EZAnimation.GetInterpolator(EZAnimation.EASING_TYPE.Linear), m_fFadeTime, m_fFadeTime, null, null);
	
		Application.LoadLevel(1);
	}
	
	
}
